package com.lagou.controller;

import org.csource.common.MyException;
import org.csource.fastdfs.ClientGlobal;

import java.io.IOException;

import org.csource.common.NameValuePair;
import org.csource.fastdfs.*;

public class TestUpload {
    public static void main(String[] args) throws IOException, MyException {
        ClientGlobal.initByProperties("config/fastdfs-client.properties");
        TrackerClient trackerClient = new TrackerClient();
        TrackerServer trackerServer = trackerClient.getConnection();
        StorageServer storageServer = null;
        StorageClient1 client = new StorageClient1(trackerServer, storageServer);
        NameValuePair[] list = new NameValuePair[1];
        list[0] = new NameValuePair("fileName", "1.jpg");
        String fileID = client.upload_file1("/Volumes/数据盘/upload/1.jpg", "jpg", list);
        System.out.println("fileID = " + fileID);
        trackerServer.close();
    }
}
